import Vue from 'vue'
import VueRouter from 'vue-router'
import Home from '../views/Home.vue'

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    name: 'home',
    component: Home,
    redirect: '../communityPension',
    children: [
      {
        path: '/communityPension',
        name: 'CommunityPension',
        component: () => import('../views/communityPension/communityPension.vue')
      },
      {
        path: '/livingPension',
        name: 'LivingPension',
        component: () => import('../views/livingPension/livingPension.vue')
      },
      {
        path: '/elderData',
        name: 'ElderData',
        component: () => import('../views/elderData/elderData.vue')
      },
      {
        path: '/pensionOrganization',
        name: 'PensionOrganization',
        component: () => import('../views/pensionOrganization/pensionOrganization.vue')
      },
      {
        path: '/pensionData',
        name: 'PensionData',
        component: () => import('../views/pensionData/pensionData.vue')
      }
    ]
  }
]

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})

export default router
